Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Build nav column and header #51

Merged
merged 21 commits into from
Dec 8, 2024

Conversation

kylezryr
Copy link
Collaborator

@kylezryr kylezryr commented Nov 22, 2024

What's new in this PR 🧑‍🌾

Description

  • Created NavColumn and Header component under NavSystem
  • Added links to View Plants and Planting Timeline pages in the NavColumn with conditional styling
  • Show different icons/buttons in Header and NavColumn depending on whether user is logged in and/or onboarded

Screenshots

Previously:
image
image
image
image

Most Updated:

Not Logged In
Screen Shot 2024-12-07 at 10 18 44 PM
Screen Shot 2024-12-07 at 9 50 54 PM

Logged In, Not Onboarded
Screen Shot 2024-12-07 at 10 19 06 PM
Screen Shot 2024-12-07 at 9 50 45 PM

Logged In, Onboarded
Screen Shot 2024-12-07 at 10 19 28 PM
Screen Shot 2024-12-07 at 9 51 10 PM

How to review

  • Check that header displays on every page except /onboarding
  • Check that pressing the nav links in the NavColumn route you to the correct page with the correct styling
  • Check that login / signup / sign out buttons work

Next steps

  • Styling for transitions when opening/closing NavColumn?
  • Waiting on designs for the header when user is not logged in/hasn't completed onboarding
  • Consolidate Button Styles in components/Button.tsx, e.g.
    • HamburgerButton
    • LoginButton/SignUp Button -- they're really the same button, but with diff colors.
    • SignOut/Onboarding Button -- they're really the same button, but with diff colors.
  • use CONFIG throughout the app
  • maybe throw/catch an error for signOut

Relevant links

Online sources

Related PRs

CC: @ccatherinetan

@kylezryr kylezryr force-pushed the 47-build-nav-column-and-header branch from 6c8b7f8 to 064f6e8 Compare November 24, 2024 05:18
@kylezryr kylezryr marked this pull request as ready for review November 24, 2024 06:21
@kylezryr kylezryr linked an issue Nov 24, 2024 that may be closed by this pull request
Copy link
Collaborator

@ccatherinetan ccatherinetan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omfg it's so amazing ty kyle! i didn't get to go thru all the styles very in depth (i might submit another review shortly) but it's looking great!

  • the main thing is to map UserTypeEnum to the actual string we want to display (see my comment)
  • destructure StyledComponents props (and make sure they start with $)

components/Header/index.tsx Outdated Show resolved Hide resolved
const handleSignOut = () => {
router.push(CONFIG.login);
onClose();
signOut();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: we might need to add additional error catching here in the future, but this is great!

Comment on lines +41 to +43
export const HamburgerIcon = styled(Icon)`
fill: ${COLORS.shrub};
`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm... i think kevin was able to do this before in the Review Onboarding PR - i'll try to link it soon

</defs>
</svg>
),
logo: (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might consider importing this as a png rather than an svg if the file is large but we can come back to this!

components/Header/index.tsx Outdated Show resolved Hide resolved
components/NavColumnItem/index.tsx Outdated Show resolved Hide resolved
components/NavColumnItem/styles.ts Outdated Show resolved Hide resolved
components/NavColumnItem/styles.ts Outdated Show resolved Hide resolved
components/NavColumnItem/styles.ts Outdated Show resolved Hide resolved
components/NavColumn/styles.ts Outdated Show resolved Hide resolved
@kylezryr kylezryr force-pushed the 47-build-nav-column-and-header branch from ce26e31 to 6660055 Compare December 3, 2024 18:30
Copy link
Collaborator

@ccatherinetan ccatherinetan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional changes

  • check profileReady and profileData → if not profileReady have a loading style in the bottom half of the nav column
  • if not profileData, show the Go To Onboarding button

<HamburgerButton onClick={onNavColumnClick}>
<Icon type="hamburger" />
</HamburgerButton>
<Link href="/">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this link can also be added to CONFIG!

home: "/",

@kylezryr kylezryr force-pushed the 47-build-nav-column-and-header branch from df551a0 to 314d8f9 Compare December 7, 2024 23:46
)
) : (
// display login link if user is not logged in
<Link href={CONFIG.login}>Login/Sign Up</Link>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just say Login here, since it's not routing to Signup.
Or, you can create another link with Sign Up.
maybe the gap between the 2 links can be 8px

Comment on lines 111 to 116
<H3 $color={COLORS.shrub} style={{ fontWeight: 300 }}>
Your Account
</H3>
<H4 $color={COLORS.shrub} style={{ fontWeight: 300 }}>
{formatUserType(profileData?.user_type as UserTypeEnum)}
</H4>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your Account should be H4 and User Type should be P3
also let's not use style prop if possible. instead use the $fontWeight prop directly


return (
<Container>
<HamburgerButton onClick={onNavColumnClick}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to eventually consolidate all button styles and include them in components/Button.tsx. in this case, we could use a button that basically has no background, outline etc.

Copy link
Collaborator

@ccatherinetan ccatherinetan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tysm kyle! it's ready to merge!

next steps: consolidate buttons styles, e.g.

  • HamburgerButton
  • LoginButton/SignUp Button -- they're really the same button, but with diff colors.
  • SignOut/Onboarding Button -- they're really the same button, but with diff colors.

font-size: 0.875rem;
`;

export const OnboardingButton = styled(Link)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, eventually we can consolidate the button styles in component/Button.tsx so that they can be reusable! this big button style is used quite frequently in the app

@ccatherinetan ccatherinetan merged commit 77d2fa2 into main Dec 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build Nav Column and Header
2 participants